namespace CSharpPro2._0925;

public class Demo
{
    private string name;


    public void Print()
    {
        Console.WriteLine(name);
    }

    public void TestPrint()
    {
        Console.WriteLine("请输入一个三位数：");
        int num  = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine(num/100);
        Console.WriteLine(num/10%10);
        Console.WriteLine(num%10);
    }

    public void TestPrint2()
    {
        Console.WriteLine("请输入一个年份:");
        int num1 = Convert.ToInt32(Console.ReadLine());
        bool flag = (num1 % 4 == 0 && num1 % 100 != 0) || num1 % 400 == 0;
        if (flag)
        {
            Console.WriteLine("是闰年");
        }
        else
        {
            Console.WriteLine("不是闰年");
        }
       
    }

    public void TestPrint3()
    {
        double money = 8800;
        Console.WriteLine("请输入月份");
        int mouth = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("请输入出行方式：1为航班出行，2为动车出行");
        int go =  Convert.ToInt32(Console.ReadLine());
        if (mouth >= 5 && mouth <= 10)
        {
            if (go == 1)
            {
                money = money * 0.9;
            }
            else
            {
                money = money * 0.75;
            }
        } 
        else
        {
            if (go == 1)
            {
                money = money * 0.6;
            }
            else
            {
                money = money * 0.3;
            }
        }
        Console.WriteLine(money);
    }
      
}